Skip to content

chore: update_root, sync_root_with_cwd, refactor with move_missing_val #1359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 26, 2022

Conversation

alex-courtis
Copy link
Member

@alex-courtis alex-courtis commented Jun 19, 2022

closes #1342 , refactoring some options

move_missing_val took too long to write :(

validate_options is the bit I'd like you to review.

@alex-courtis alex-courtis requested a review from kyazdani42 June 19, 2022 03:52
@alex-courtis
Copy link
Member Author

I haven't forgotten about the git concurrency... just poking away until I find a nice solution.

-- @param dst_pos value pos
function M.move_missing_val(src, src_path, src_pos, dst, dst_path, dst_pos)
if
not pcall(vim.validate, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can deliberaly fail when this function is called with the wrong arguments instead of silently returning ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works. Are you thinking of a warning message?

Signing off for now... I'll get to this on the weekend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 have a good week !

Copy link
Member Author

@alex-courtis alex-courtis Jun 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. This is a nice pattern we can use more.

[NvimTree] move_missing_val: dst_path: expected string, got number

@kyazdani42
Copy link
Member

Thanks @alex-courtis, please rebase :)

@alex-courtis alex-courtis merged commit 0c13bd7 into master Jun 26, 2022
@kyazdani42 kyazdani42 deleted the 1342-sync_root_with_cwd branch June 26, 2022 10:12
ellsclytn added a commit to ellsclytn/dotfiles that referenced this pull request Jul 31, 2022
update_to_buf_dir is now replaced with hijack_directories. That said, I
never had any use fot it. update_cwd was depreated in favour of
sync_root_with_cwd.

nvim-tree/nvim-tree.lua#1359
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
nvim-tree#1359)

* chore: opts.update_focused_file.update_cwd -> update_root

* chore: opts.update_cwd -> sync_root_with_cwd

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: sync_root_with_cwd
2 participants